package com.chixing.day13.ArrayList;

import java.util.Iterator;
import java.util.TreeSet;

public class TreeSetDemo {
    public static void main(String[] args){
        //添加若干String,再遍历
        TreeSet set = new TreeSet();
        set.add("one");
        set.add("two");
        set.add("three");
        set.add("four");
        set.add("five");
        set.add("six");
        Iterator iter = set.iterator();
        while (iter.hasNext()) {
            String s = (String) iter.next();
            System.out.println(s);
        }



        //添加若干Student,再遍历

    }
}
